/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package orkomet;

import javax.xml.ws.Endpoint;

/**
 *
 * @author Schimi
 */
public class WsPublisher extends Thread {
    private static final String WSURI="http://localhost:8765/Orkomet";
    private Endpoint endpoint;
    
    @Override
    public void run() {
        endpoint=Endpoint.publish(WSURI, new Frontend());
        Main.getInstance().notifyObservers();
    }
    
    public boolean isStartable()
    {
        if(endpoint==null) return true;
        return endpoint.isPublished();
    }
    
    public void endPublish()
    {
       if(endpoint!=null)
            endpoint.stop();
       Main.getInstance().notifyObservers();
    }
    
}
